            <!-- Begin: Wrapper Header -->
            <div class="header hidden">
<? Shell::showWidgets('wrapper-header') ?>
            </div> <!-- End -->
            
            <!-- Begin: Sidebar Left -->
            <div class="sidebar left">
<? Shell::showWidgets('sidebar-left') ?>                
            </div> <!-- End -->
            
            <!-- Begin: Content About Us -->
            <div class="content comparative">
                <?  
                    session_start();
                    /*$_SESSION['vehicle_comparative'][] = 1;*/
                    //$_SESSION['vehicle_comparative'][] = 2;
                    /*$_SESSION['vehicle_comparative'][] = 3;
                    $_SESSION['vehicle_comparative'][] = 4;*/
                    
                    /*echo $chave = array_search(2, $_SESSION['vehicle_comparative']); //localizo o valor na array
                    unset($_SESSION['vehicle_comparative'][$chave]);*/
                ?>
                <div class="header"><h1>Comparativo de Veículo</h1></div>
                <?
                $total_register = count($_SESSION['vehicle_comparative']);
                if($total_register>1):
                    $width = 171*($total_register);
                    if($total_register<4):
                        $width_mask = 171*($total_register);
                    else:
                        $width_mask = 682;
                    endif;
                    $count = 0;
                    if(isset($_SESSION['vehicle_comparative'])):
                    foreach ($_SESSION['vehicle_comparative'] as $id_vehicle):
                        //$id_vehicle = 31;
                        //$id_vehicle = 15;
                        $data = DbGet::vehicle($id_vehicle);
                        $vehicle_image = DbGet::vehicle_pictures($id_vehicle);
                        $vehicle_image = $vehicle_image[0];
                        if($count==0):
                    ?>
                    <div class="slide-comparative-mask" style="width: <?=$width_mask?>px;">                    
                        <div class="slide-comparative" style="width:<?=$width?>px;overflow: hidden;margin-left: 0px;height: auto;padding-left: 1px;">
                        <? endif; ?>
                        <ul class="table-comparative" id="<?=$id_vehicle?>" rel="<?=$id_vehicle?>">
                            <li><a href="javascript:;" class="remove-comparative">Remover Anúncio</a></li>
                            <li>
                                <img src="<?= _VHC_IMG_ ?>search/<?=$vehicle_image->filename?>">
                                <a href="<?= __BASE_URI__.urlencode(strtolower($data->t_name)).'/'.urlencode(strtolower($data->m_name)).'/'.urlencode(strtolower($data->b_name)).'/'.$data->firstreg.'/'.$data->v_id ?>" class="view">Visualizar Anúncio</a>
                            </li>
                            <li class="gray"><?=$data->b_name;?></li>
                            <li><?=$data->m_name;?></li>
                            <li class="price">R$ <?=number_format($data->price,2,",",".");?></li>
                            <li class="gray">Portas: <?=$data->doors;?></li>
                            <li ><?=$data->firstreg;?> / <?=$data->modelyear;?></li>
                            <li class="gray"><?=$data->c_name;?></li>
                            <li>
                            Final Placa:
                            <? if($data->plate): ?>
                            <?=substr($data->plate,5,1); ?>
                            <? else: ?>
                            -
                            <? endif; ?>
                            </li>
                            <li class="gray"><?=$data->firstreg;?></li>
                            <li>
                                <div class="detail">
                                    <ul>
                                <?
                                $data_detail = DbGet::vehicle_details($id_vehicle);
                                if(isset($data_detail)): ?>
                                        <li class="item detail-describe">Detalhes:</li>
                                    <? foreach($data_detail as $vehicle_details):?>
                                        <li class="item"><?=$vehicle_details->d_name?></li>
                                    <?
                                    endforeach;
                                else:
                                ?>
                                -
                                <? endif; ?>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <?
                                $data_enterprise = DbGet::enterprise_vehicle($id_vehicle);
                                $data_customer = DbGet::customer_vehicle($id_vehicle);
                                if($data_enterprise):
                                    $data_phone = DbGet::phones($data_enterprise->e_id,'J');
                                    $data_phone=$data_phone[0];
                                ?>
                                <img class="private" src="<?= _ETP_IMG_ ?>logo/<?= empty($data_enterprise->filebrand) ? 'no-image.jpg' : $data_enterprise->filebrand ?>" />

                                <div class="phone"><?=Util::format_phone($data_phone->p_areacode.$data_phone->p_number)?></div>
                                <? elseif($data_customer): ;
                                    $data_phone = DbGet::phones($data_customer->c_id,'F');
                                    $data_phone=$data_phone[0];
                                    ?>
                                <div class="particular">Veículo Particular</div>
                                <div class="phone"><?=Util::format_phone($data_phone->p_areacode.$data_phone->p_number)?></div>
                                <? endif; ?>
                            </li>
                        </ul>
                        <? if($count+1==$total_register): ?>
                        </div>
                    </div>
                        <?
                        endif;
                    $count = $count+1;
                    endforeach;
                    endif;
                    ?>
                    <?
                if($count>4): ?>
                <a href="javascript:;" class="previous"></a>
                <a href="javascript:;" class="next"></a>
                <? endif; 
                else:
                    if($total_register>0):
                ?>
                Você selecionou somente um veículo. Para a comparação é necessário selecionar dois ou mais.
                <?elseif($total_register==0):?>
                Você não selecionou nenhum veículo.
                <?
                  endif;
                endif;
                ?>
            </div> <!-- End -->
            
            
